Misc cleanups for valgrind.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 26 Aug 2005 17:52:58 +0000 (17:52 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 26 Aug 2005 17:52:58 +0000 (17:52 +0000)
gpsbabel/hsa_ndv.c

index eb2bd78d406a2116856d4412ed1db2d1c61b29bd..9fb6a73a7ad68564f359b8e550bc6eab9c37aaaf 100644 (file)
@@ -377,9 +377,9 @@ void readVersion4( FILE* pFile)
 {
        while( TRUE )
        {
-               char recData[256];
+               char recData[256] = {0};
                // get the position
-               double  lat2, lng2;
+               double  lat2, lng2 = 0;
 
                // set the pointer to the time stamp depending
                // on whether we have a sounding array or not
@@ -393,7 +393,7 @@ void readVersion4( FILE* pFile)
                char attr[1024];
                int Vertex;
 
-               memset(attr, 0, 1024);
+               memset(attr, 0, sizeof(attr));
 
                wpt_tmp = xcalloc(sizeof(*wpt_tmp), 1);
                wpt_tmp->altitude = unknown_alt;
@@ -521,7 +521,8 @@ int readPositionRecord( FILE* pFile, double* lat, double* lng,
                                                long* timeStamp)
 {
        // read the lat record
-       char recData[256];
+       char recData[256] = {0};
+
        if( !readRecord( pFile, EF_LAT_REC, recData) )
                // no lat record then finished
                return FALSE;